UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LnRqgT2Xpy5k9oBd1vdPwo2UGmi/l27WFADfDqZsgvY=' 
WHERE 
  key_id = '5f9a2418d43860e6ee6e2357603fb48aa670e3c294b8188c68febad18f01124e' 
  AND (
    token = 'LnRqgT2Xpy5k9oBd1vdPwo2UGmi/l27WFADfDqZsgvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048