UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UiKMVCZCJrXU2cQtVREFsjobryH17+OpiC+ktnvU+J8=' 
WHERE 
  key_id = 'e1d56d4e78473d724a80bd3a46b5d4b9a6d3585a77f0ded50cc4bdee001ebffb' 
  AND (
    token = 'UiKMVCZCJrXU2cQtVREFsjobryH17+OpiC+ktnvU+J8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025