UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mWyNRCci7vhDgGK4rK54DEayWQn5W17TwBoHIiaPUpA=' 
WHERE 
  key_id = '5fbb3d28f661f0ecef39acb6331df9dc1bff3c5f6e3b17f9b036dbfc4034d762' 
  AND (
    token = 'mWyNRCci7vhDgGK4rK54DEayWQn5W17TwBoHIiaPUpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034