UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CJoUCmTf6W7BaavmIC5yjby3vrTwGccwrnQ8pIiy5hs=' 
WHERE 
  key_id = '14ecc8b8b1bfeb6c2d9c1bd9dec445a4f7d57f97448b88eb3a78ef9af685e554' 
  AND (
    token = 'CJoUCmTf6W7BaavmIC5yjby3vrTwGccwrnQ8pIiy5hs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024