UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y1GQJBXdY/kAllUAI7zFdpQLcZ26hrmMNe4akwdMC8A=' 
WHERE 
  key_id = 'bda240a7b75cb57e08b16f19211653d0ce822b6e7d7fefd2f9934eeeeec77979' 
  AND (
    token = 'Y1GQJBXdY/kAllUAI7zFdpQLcZ26hrmMNe4akwdMC8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017