UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PsJCSHKsAJpdG4FzWG5+RvYnNeq1qVfJBVJ2TjR9l70=' 
WHERE 
  key_id = '89fc11c2a80598fcdbbd6785f9b8979590703f61b3fe25eb7aa7b0fc58e8e59a' 
  AND (
    token = 'PsJCSHKsAJpdG4FzWG5+RvYnNeq1qVfJBVJ2TjR9l70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042