UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BUtFBOGPXemuNX1hiUj4cFSGufkTulro4+nW2x/uE7Q=' 
WHERE 
  key_id = '35de8b9576c854d8e8ecf86ef5b6aa42a3d66aa2dc781c5817b37d0b4f31f0e5' 
  AND (
    token = 'BUtFBOGPXemuNX1hiUj4cFSGufkTulro4+nW2x/uE7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030