UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wqvZkGvDHBvSZF6x/wSpbtouZgQP+S3UlFZ9t2Lot3w=' 
WHERE 
  key_id = '7702f119d346fcd23e1ca1911ec092c5788d9e4c59681ab2d12cc904196b5b4f' 
  AND (
    token = 'wqvZkGvDHBvSZF6x/wSpbtouZgQP+S3UlFZ9t2Lot3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025