UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FiAxfWeY//qdyIv7T313Cjt9JJTbuhO7dQgJSeZzo3w=' 
WHERE 
  key_id = '081d17b3faae45e5321e35f275399b154cc7bb5684eae291030df139ab7fa8e9' 
  AND (
    token = 'FiAxfWeY//qdyIv7T313Cjt9JJTbuhO7dQgJSeZzo3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031