UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PZhipDj37c5x7Uy7x/2IPtupGZr0zWHqwFPHW3j2vZA=' 
WHERE 
  key_id = 'da9663c21f3fb626b1c83e28de70034aaad762a91d189b23ba8dbd9c4f80e237' 
  AND (
    token = 'PZhipDj37c5x7Uy7x/2IPtupGZr0zWHqwFPHW3j2vZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034