UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ku+24fnqvWh5Rdl5l6pHWrZ+0VK6xsna36tKu7eOatw=' 
WHERE 
  key_id = '0c023a1da88e7f181b3fbdbefe7b140228d3f3d5d1caa839d6f0e1b4b21d300f' 
  AND (
    token = 'Ku+24fnqvWh5Rdl5l6pHWrZ+0VK6xsna36tKu7eOatw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033