UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BiA8NKzfNZK9FAwi4S0s/iaHeTSK994zWkxHCVNkmwE=' 
WHERE 
  key_id = 'f5aae1030df164408aa1e5e31b7a8e7886bd4f408bb0f60b01d6bdaa295cd2c4' 
  AND (
    token = 'BiA8NKzfNZK9FAwi4S0s/iaHeTSK994zWkxHCVNkmwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042