UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wK8JizL89eIyXU9nFqr7+4JkjdqU3LeElFNBtrbDsCU=' 
WHERE 
  key_id = 'a3b4a0205585d26021f1dda5670c603642f156afe40d8d57ea7d663f8a887ac3' 
  AND (
    token = 'wK8JizL89eIyXU9nFqr7+4JkjdqU3LeElFNBtrbDsCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020