UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h9+ETvew1zwnBg1pX5rVfHy4AK/tIZqUrtwO1teCqi0=' 
WHERE 
  key_id = 'd9a3a3b2da994d641c436d23ba187b93cd10b690c1946011f638ef99d63e81a9' 
  AND (
    token = 'h9+ETvew1zwnBg1pX5rVfHy4AK/tIZqUrtwO1teCqi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059