UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oJYLSJMALsSRxqWcUyC4/gRfxexPz/pB7MoTl/zATM0=' 
WHERE 
  key_id = 'c9ff08619c26fc8ef0dbfa46fcfbae37ca65bdab8717931ec24d8771fbc8fce8' 
  AND (
    token = 'oJYLSJMALsSRxqWcUyC4/gRfxexPz/pB7MoTl/zATM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038