UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'odFBPF/J8C4bkW1jQ3ANkVQGvi8ky4UfSymkduaUgbo=' 
WHERE 
  key_id = 'c9eebb98f719d8a38422ab5a766b37dc8ea71ef42e2db585353437d72d552485' 
  AND (
    token = 'odFBPF/J8C4bkW1jQ3ANkVQGvi8ky4UfSymkduaUgbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052