UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evNkx1ZvVNICBa5PNu+4Ny6Fcp6Qf3/c0cbeY2QHAmk=' 
WHERE 
  key_id = '29d1afffb365ce8c44ac91ec9bea40536d3c09892203b9ae384bf279e2f55887' 
  AND (
    token = 'evNkx1ZvVNICBa5PNu+4Ny6Fcp6Qf3/c0cbeY2QHAmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030