UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LjjLRY0NmQ7gJRbhqKo7cMEx6fLG3etZhuHPs0XySgs=' 
WHERE 
  key_id = '95cb683a7c09d031e52d42b2c960f3523fed4383235627bbfa17936db20a81a3' 
  AND (
    token = 'LjjLRY0NmQ7gJRbhqKo7cMEx6fLG3etZhuHPs0XySgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036