UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8HRLP+g/9fuvZjRQUczD2/ovFk0RXFU58b/Iud53Oo=' 
WHERE 
  key_id = '10c93836f56d5e1d74e37dee352a3689ad3ec568d17fdb6421fe1fd13d27235d' 
  AND (
    token = 'X8HRLP+g/9fuvZjRQUczD2/ovFk0RXFU58b/Iud53Oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022