UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dATQZAucsbLPts+W2CcZ/7S7x0+vzj6Y0nq9TRBXhFk=' 
WHERE 
  key_id = '3ce8ea42cea3e6d4fcc721328b5b54784a50d000dabdc6cbded5b96a5b43b538' 
  AND (
    token = 'dATQZAucsbLPts+W2CcZ/7S7x0+vzj6Y0nq9TRBXhFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057