UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IBlAtv0MqP/bTeHYT1FgIT2BsAh7ptH4D9lPt3lAW4k=' 
WHERE 
  key_id = 'eab7af2a566194c927cfbd6d35924232c73499685dfc703b79d3a889fc1d66f7' 
  AND (
    token = 'IBlAtv0MqP/bTeHYT1FgIT2BsAh7ptH4D9lPt3lAW4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024