UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ApsLtTF7oxPVYH8b2p9TWq+riQobv5RZvWyz2Pa/oCU=' 
WHERE 
  key_id = '00af03221755a578077ad11a351e74ef029fc87f88ebf5e7da43bfdc9ae7676f' 
  AND (
    token = 'ApsLtTF7oxPVYH8b2p9TWq+riQobv5RZvWyz2Pa/oCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018