UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dMcvZ21Txk+Qld9RDBZKfHx6dE2s7OIvtCdQl5mdCss=' 
WHERE 
  key_id = 'e4e054e256e69493093f13252728d3561506032c2cca3dd68779602ac54da400' 
  AND (
    token = 'dMcvZ21Txk+Qld9RDBZKfHx6dE2s7OIvtCdQl5mdCss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027