UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dNz3HN4nsDH7EgRWO7dJl8z3XHfsgL945u3mAyGbanQ=' 
WHERE 
  key_id = '0e5f6cf13cdbd663d4a7a2e9694a08df9722b10751bcaa8f8636b6c4fd080000' 
  AND (
    token = 'dNz3HN4nsDH7EgRWO7dJl8z3XHfsgL945u3mAyGbanQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018