UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+VWTP7KwHZ6DdLe5WwDX16vRvaWJjrfnqUBn2Cgkkbc=' 
WHERE 
  key_id = '7463d7620e7498b4c72bb895412231ca7efcf272dfada7521c05976a43bc9cfa' 
  AND (
    token = '+VWTP7KwHZ6DdLe5WwDX16vRvaWJjrfnqUBn2Cgkkbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018