UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bis7bt+Rsg6iRd3IEijI8+gaBHCYV8ZkVwkghEUER6o=' 
WHERE 
  key_id = '517ae676825ce8c5b503b2a2e7e6eed8f9f0c6c751bed2e9f76a12b49049a0bd' 
  AND (
    token = 'bis7bt+Rsg6iRd3IEijI8+gaBHCYV8ZkVwkghEUER6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022