UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DCmySQuGXBN5WgitsNJhNbybGq0hH6N4K3DQTy0TbsE=' 
WHERE 
  key_id = '67415fec6a5d8262393c20855d8bcf73d3378e86bcbc399602a4aad35dbc564c' 
  AND (
    token = 'DCmySQuGXBN5WgitsNJhNbybGq0hH6N4K3DQTy0TbsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045