UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/LTXnSzzuGP/SD7rdDn0qqA7Rpzp7S+4zkean8ruRvM=' 
WHERE 
  key_id = '054e8322970b7f0b8ede5b5681b1adcfbfcf20caae51874de891f3b8f455d40d' 
  AND (
    token = '/LTXnSzzuGP/SD7rdDn0qqA7Rpzp7S+4zkean8ruRvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026