UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '79X6OmMHb6o7VMnQiGEMAKcLkiLjfU8JYC5B+vCNiWo=' 
WHERE 
  key_id = '675e8ae6a0f3111bd33f625afc224e0bb44c3f38cf6cf4f308e10dfd03b88e65' 
  AND (
    token = '79X6OmMHb6o7VMnQiGEMAKcLkiLjfU8JYC5B+vCNiWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045